<template>
    <div>
    </div>
</template>

<script>
    export default {
        name: "single-app",
        data(){
            return{

            }
        },
        methods:{
            //$router.push({path:'/single-app',query:{name:11,list:222}})
            //用法通过vue  路由跳转 携带 query 信息到本页面 后 调用  getRouteInfo() 实现跳转
             getRouteInfo(){
                     let info=this.$route.query;
                     let url= info.header+"://"+info.thirdIp+info.methodName;
                     let  data= {
                         infoID:info.infoID,
                         templateName:info.templateName,
                         authToken:info.authToken
                     }
    
                     this.fromPost(url,data)
             },
            fromPost(url,data) {  // to:提交动作（action）,p:参数
                let myForm = document.createElement("form");
                let data1=data;
                myForm.target = "_self";
                myForm.method = "post";
                myForm.action = url;
                for (var i in data1) {
                    let myInputUserCode = document.createElement("input");
                    myInputUserCode.setAttribute("name", i);  // 为input对象设置name
                    myInputUserCode.setAttribute("value", data1[i]);  // 为input对象设置value
                    myForm.appendChild(myInputUserCode);
                }
                document.body.appendChild(myForm);
                myForm.submit();
                document.body.removeChild(myForm);  // 提交后移除创建的form
            }
        },
        mounted(){
         this.getRouteInfo();
        }
    }
</script>

<style scoped>

</style>
